//
//  MPublicManager.h
//  DiDiHousekeeping
//
//  Created by Mask魏 on 14/11/25.
//  Copyright (c) 2014年 Mstarc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


@interface MPublicManager : NSObject

/**
 当前正在显示的Controllr
 */
@property(nonatomic,strong)UIViewController * currentControllr;



/**
 获取单例

 @return instancetype
 */
+ (instancetype)sharedPublicManager;

/**
 提交时使用

 @param listName 要存储的表名
 @param obj 模型对象
 @param successfulBlock 成功回调
 @param errorBlock 失败回调
 */
+ (void)submitListName:(NSString *)listName obj:(NSObject *)obj successfulBlock:(void(^)(void))successfulBlock errorBlock:(void(^)(NSString *))errorBlock;


/**
 批量上传图片
 
 @param images <UIImage *>* 数组里只能是UIImage对象
 @param successfulBlock 成功返回 url 数组
 @param proportion 是否上传带有图片比例的 url
 @param errorBlock errorBlock
 */
+ (void)batchUploadImages:(NSArray <UIImage *>*)images proportion:(BOOL)proportion successfulBlock:(void(^)(NSArray* imageUrls))successfulBlock errorBlock:(void(^)(void))errorBlock;

/**
 单张图片上传
 
 @param image UIImage 对象
 @param successfulBlock 成功后返回url
 @param errorBlock errorBlock
 */
+ (void)uploadImage:(UIImage *)image successfulBlock:(void(^)(NSString * urlStr))successfulBlock errorBlock:(void(^)(void))errorBlock;

@end
